package com.example.friend.controller;

import com.example.common.core.domain.TableDataInfo;
import com.example.friend.domain.exam.dto.ExamQueryDTO;
import com.example.friend.service.IExamService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/exam")
public class ExamController {

    @Autowired
    private IExamService examService;


    @GetMapping("/semiLogin/list")
    public TableDataInfo list(ExamQueryDTO examQueryDTO) {
        log.info("list->/exam/semiLogin/list:ExamQueryDTO{}", examQueryDTO);
        return TableDataInfo.success(examService.list(examQueryDTO),
                examService.total(examQueryDTO));
    }

    @GetMapping("/semiLogin/redis/list")
    public TableDataInfo redisList(ExamQueryDTO examQueryDTO) {
        log.info("list->/exam/semiLogin/redis/list:ExamQueryDTO{}", examQueryDTO);
        return examService.redisList(examQueryDTO);
    }
}
